package net.xyz.invocation;

import java.util.ArrayList;

public class MethodBean {
	private String methodName;
	private long id;
	private ArrayList<String> args= new ArrayList<String>(); 
	public MethodBean(String _methodName,long _id,String _input){
		this.methodName=_methodName;
		this.id = _id;
		
		if(_input!=null && !_input.equals("")){
			String[] _args = _input.split(",");
			int i = 0;//_args.length;
			while(i<_args.length){
				args.add(_args[i]);
				i++;
			}
		}
	}
	public long compare(String name,ArrayList<String> params){
		long rs = -1;
		if(!name.equals(methodName)){
			return rs;
		}
		if(params.size()!= args.size()){
			return rs;
		}
		if(params.containsAll(args)){
			return id;
		}
		
		return rs;
	}
	public static void main(String[] args){
		ArrayList<String> a= new ArrayList<String>();
		ArrayList<String> b= new ArrayList<String>();
		a.add("sdff");
		a.add("sdffs");
		b.add("sdff");
		System.out.println(a.containsAll(b));
	}
}
